package com.gegewa.topic.response;

import lombok.Data;

/**
 * 基本返回类型
 * 
 * Created by dengyuanping on 2016/8/15.
 */
@Data
public class BaseResponse {

	/**
	 * 是否成功
	 */
	private boolean success;

	/**
	 * 消息
	 */
	private String message;

	protected BaseResponse() {

	}

	public boolean isSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public static BaseResponse success() {
		BaseResponse baseResponse = new BaseResponse();
		baseResponse.setSuccess(true);
		return baseResponse;
	}

	public static BaseResponse fail(String message) {
		BaseResponse baseResponse = new BaseResponse();
		baseResponse.setMessage(message);
		return baseResponse;
	}

}
